package com.demo.entity.po;

import java.io.Serializable;

import java.util.Date;
import java.util.List;

import com.demo.annotation.VerifyParam;
import com.fasterxml.jackson.annotation.JsonFormat;

import org.springframework.format.annotation.DateTimeFormat;

/**
 * @Description:评论表
 * @Date:2025-03-01
 * @author：author
*/
public class Comment implements Serializable {

	/**
	 * 评论ID，主键，自增
	 */
	private Long commentId;

	/**
	 * 关联的帖子ID，外键
	 */
	private Long postId;

	/**
	 * 评论用户ID，外键
	 */
	private Long userId;

	private String avatar;

	private String username;


	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	/**
	 * 父评论ID，用于嵌套评论（回复评论）
	 */
	private Long parentCommentId;

	/**
	 * 评论内容
	 */
	@VerifyParam(required = true)
	private String content;

	/**
	 * 评论时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;

	/**
	 * 最后更新时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date updateTime;

	/**
	 * 评论状态：正常、已删除
	 */
	private Integer status;

	List<Comment> replies;

	public List<Comment> getReplies() {
		return replies;
	}

	public void setReplies(List<Comment> replies) {
		this.replies = replies;
	}

	public void setCommentId(Long commentId) {
		this.commentId = commentId;
	}

	public Long getCommentId() {
		return this.commentId;
	}

	public void setPostId(Long postId) {
		this.postId = postId;
	}

	public Long getPostId() {
		return this.postId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getUserId() {
		return this.userId;
	}

	public void setParentCommentId(Long parentCommentId) {
		this.parentCommentId = parentCommentId;
	}

	public Long getParentCommentId() {
		return this.parentCommentId;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getContent() {
		return this.content;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getStatus() {
		return this.status;
	}

	@Override
	public String toString() {
		return "评论ID，主键，自增:" + commentId + ",关联的帖子ID，外键:" + postId + ",评论用户ID，外键:" + userId + ",父评论ID，用于嵌套评论（回复评论）:" + parentCommentId + ",评论内容:" + content + ",评论时间:" + createTime + ",最后更新时间:" + updateTime + ",评论状态：正常、已删除:" + status + "";
	}

}